<?php
require_once('common.php');
C('webtitle','网站管理后台');
C('pageid','index');
$index='1';
include_once 'common.head.php';
$dt = round(@disk_total_space(".")/(1024*1024*1024),3); //总
$df = round(@disk_free_space(".")/(1024*1024*1024),3); //可用
$du = $dt-$df; //已用
$hdPercent = (floatval($dt)!=0)?round($du/$dt*100,2):0;
if($_GET['xz']=='set'){
$db->query("insert into {$prefix}webconfigs set vkey='web_control_gg',value='".safestr($_POST['gg'])."' on duplicate key update value='".safestr($_POST['gg'])."'");
exit("<script language='javascript'>alert('公告修改成功');window.location.href='index.php';</script>");
}

?>
<div class="animated fadeInRight">
<div class="row border-bottom white-bg dashboard-header">
<div class="col-sm-4">
                <h2>函数检测</h2>
                <ul class="list-group clear-list m-t">
                    <table class="panel table table-striped">
					<thead>
					<tr>
						<th style="width:15%">需求</th>
						<th style="width:15%">当前</th>
						<th style="width:50%">用途</th>
					</tr>
					</thead>
					<tbody>
					<tr>
						<td>必须</td>
						<td><?php
						$ver=phpversion();
						if($ver<5.3){
						echo '<font color="red">不支持</font>';
						}else{
						echo '<font color="green">支持</font>';
						}
						?></td>
						<td>空间要求</td>
					</tr>
					<tr>
						<td>必须</td>
						<td><?php echo checkfunc('curl_exec', true); ?></td>
						<td>网页连接</td>
					</tr>
					<tr>
						<td>必须</td>
						<td><?php echo checkfunc('file_get_contents', true); ?></td>
						<td>读取文件</td>
					</tr>
					<tr>
						<td>推荐</td>
						<td><?php echo checkclass('ZipArchive'); ?></td>
						<td>后台在线升级</td>
					</tr>
					<tr>
						<td>推荐</td>
						<td><?php if (is_writable('./')) {
								echo '<font color="green">可用</font>';
							} else {
								echo '<font color="black">不支持</font>';
							} ?></td>
						<td>写入文件(1/2)</td>
					</tr>
					<tr>
						<td>推荐</td>
						<td><?php echo checkfunc('file_put_contents'); ?></td>
						<td>写入文件(2/2)</td>
					</tr>
					</tbody>
				</table>
                </ul></div>
				<div class="col-sm-4">
                    <h4>快捷功能</h4>
<ul class="todo-list m-t">
<li> <i class="fa fa-check-square-o"></i>
<span class="m-l-xs">删除非VIP会员</span>
<small class="label label-primary"><i class="fa fa-clock-o"></i> <a class="btn-primary" href="ulist.php?do=dell">一键删除</a></small>
</li>
<li> <i class="fa fa-smile-o"></i>
<span class="m-l-xs">删除已用的卡密</span>
<small class="label label-warning"><i class="fa fa-clock-o"></i> <a class="btn-warning" href="km.php?do=dell">一键删除</a></small>
</li>
<li> <i class="fa fa-slideshare"></i>
<span class="m-l-xs">清空全部卡密</span>
<small class="label label-danger"><i class="fa fa-clock-o"></i> <a class="btn-danger" href="km.php?do=delll">全部清空</a></small>
</li>
<li> <i class="fa fa-qq"></i>
<span class="m-l-xs">查看状态正常QQ</span>
<small class="label label-info"><i class="fa fa-clock-o"></i> <a class="btn-info" href="qlist.php?zt=1">点击查看</a></small>
</li>
<li> <i class="fa fa-user"></i>
<span class="m-l-xs">查看代理用户列表</span>
<small class="label label-success"><i class="fa fa-clock-o"></i> <a class="btn-success" href="ulist.php?c=daili">点击查看</a></small>
</li>
<li> <i class="fa fa-group"></i>
<span class="m-l-xs">查看副站长列表</span>
<small class="label label-danger"><i class="fa fa-clock-o"></i> <a class="btn-danger" href="ulist.php?c=fuzhan">点击查看</a></small>
</li>
</ul>
                    <div class="m-t">
                        <small></small>
                    </div>
					</div>
					<div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>网站运行状态</h5>
                    </div>
                    <div class="ibox-content">
						被禁用函数:<?=(""==($disFuns=get_cfg_var("disable_functions")))?"无":str_replace(",","<br />",$disFuns)?><br><br>
						php运行方式:<?php echo $_SERVER['SERVER_SOFTWARE'];?><br><br>
						服务器IP:<?php echo $_SERVER['SERVER_NAME'];?>(<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>)<br><br>
						操作系统:<?php $os = explode(" ", php_uname()); echo $os[0];?> &nbsp;内核版本:<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?><br><br>
						总空间 <?php echo $dt;?>&nbsp;G，
		已用 <font color='#333333'><span id="useSpace"><?php echo $du;?></span></font>&nbsp;G，
		空闲 <font color='#333333'><span id="freeSpace"><?php echo $df;?></span></font>&nbsp;G，
		使用率 <span id="hdPercent"><?php echo $hdPercent;?></span>%
		<br><br>
		Cookies支持:<?php echo isset($_COOKIE)?'<font color="green">√</font>' : '<font color="red">×</font>';?><br>
                    </div>
                </div>
            </div>
                </div>
		<div class="wrapper wrapper-content">
            <div class="row">
			<?php if($isdomain){?>
								<div class="col-sm-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5>分站公告</h5>
						<i class="fa fa-circle text-danger"></i>
						<?=get_fzgg()?>
                    </div>
                </div>
            </div>
			<?php } ?>
		<div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right">百分之十</span>
                        <h5>用户</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins"><?=get_count('users',"uid")?></h1>
                        <div class="stat-percent font-bold text-success"><?php
$a=get_count('users',"uid")
;$b=10;
$c=$a*$b/100;
echo $c."%";
?> <i class="fa fa-bolt"></i>
                        </div>
                        <small>总用户</small>
                    </div>
                </div>
				<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-info pull-right">百分之十</span>
                        <h5>QQ</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins"><?=get_count('qqs',"uid")?></h1>
                        <div class="stat-percent font-bold text-info"><?php
$a=get_count('qqs',"uid")
;$b=10;
$c=$a*$b/100;
echo $c."%";
?> <i class="fa fa-level-up"></i>
                        </div>
                        <small>总QQ</small>
                    </div>
                </div>
				<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>状态正常的QQ</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins"><?=get_count('qqs',"uid and skeyzt='1' or sidzt='1'")?></h1>
                        <div class="stat-percent font-bold text-info"><?=get_count('qqs',"uid and skeyzt='1' or sidzt='1'")?> <i class="fa fa-level-up"></i>
                        </div>
                        <small>状态正常的QQ</small>
                    </div>
                </div>
				<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-primary pull-right">今天</span>
                        <h5>访客</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins"><?=C('number')?></h1>
                        <div class="stat-percent font-bold text-navy">100% <i class="fa fa-level-up"></i>
                        </div>
                        <small>新访客</small>
                    </div>
                </div>
            </div>
		<div class="col-sm-9">
		<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>最新注册的30个用户</h5>
                    </div>
                    <div class="ibox-content tooltip-demo">
                        <?php if($rows=$db->get_results("select * from {$prefix}users where 1 order by uid desc limit 30")){ foreach($rows as $row){?>
								   <img alt="image" data-toggle="tooltip" data-placement="top" title="<?=$row[user]?>" data-original-title="<?=$row[user]?>" class="img-circle" src="http://q4.qlogo.cn/headimg_dl?dst_uin=<?=$row[qq]?>&amp;spec=40">
				<?php }}?>
                    </div>
        </div>
		<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>最新添加的30个QQ</h5>
                    </div>
                    <div class="ibox-content tooltip-demo">
                        <?php if($rows=$db->get_results("select * from {$prefix}qqs where 1 order by qid desc limit 30")){ foreach($rows as $row){?>
								   <img alt="image" data-toggle="tooltip" data-placement="top" title="QQ:<?=$row[qq]?>" data-original-title="QQ:<?=$row[qq]?>" class="img-circle" src="//q1.qlogo.cn/g?b=qq&nk=<?=$row[qq]?>&s=40">
				<?php }}?>
                    </div>
        </div>
		</div>
		</div>
	</div>
    </div>
	  <?php
include_once 'common.foot.php';
?>